Skip to content

Conversation

@alfredomariamilano
Copy link
Contributor

Remove the use of the deprecated Webpack MainTemplate. If __nccwpck__ is not present, fall back to __webpack_require__. It fixes the regression from 1.7.3 to 1.7.4 and it also allows for compatibility with rspack.

Remove the use of the deprecated Webpack MainTemplate.
If `__nccwpck__` is not present, fall back to `__webpack_require__`.
It fixes the regression from 1.7.3 to 1.7.4 vercel#188 and it also allows for compatibility with `rspack` https://github.com/web-infra-dev/rspack.
@alfredomariamilano alfredomariamilano changed the title [FIX]: 1.7.3 to 1.7.4 regression fix: 1.7.3 to 1.7.4 regression Oct 8, 2024
@alfredomariamilano alfredomariamilano marked this pull request as draft October 8, 2024 17:46
@alfredomariamilano
Copy link
Contributor Author

I'm sorry, I had not run the tests, as it was working as intended. I have a better understanding of how ncc works now and how someone mistakenly made this package compatible only with ncc and broke compatibility with webpack completely.
I have a dirty workaround for this without having to update ncc too and keep this module independent.
I will update the PR tomorrow.

ran and updated all tests
@alfredomariamilano alfredomariamilano marked this pull request as ready for review October 9, 2024 13:49
@alfredomariamilano
Copy link
Contributor Author

Unfortunately, all tests had to be reran and rewritten and I kept ncc as a build tool, but I changed the output by reverting ncc's changes to the string __webpack_require__. This makes it dependent on ncc not changing this behaviour again in the future, but considering the two projects are intermingled and the versions are pinned, it shouldn't be a problem.

@styfle
Copy link
Member

styfle commented Oct 11, 2024

Looks like the module ids are different on linux

@github-actions
Copy link

github-actions bot commented Jul 3, 2025

🎉 This issue has been resolved in version 1.7.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

yjoer added a commit to yjoer/webpack-asset-relocator-loader that referenced this pull request Jul 3, 2025
…rcel#195)

While exploring the idea of dropping ncc and using webpack to build the
loader directly in [this
branch](https://github.com/yjoer/webpack-asset-relocator-loader/tree/patch-2),
I noticed that 31 outputs differ from their corresponding coverage
outputs. These differences are consistent across the changes made here,
so I believe we can update the coverage outputs to reflect this
variation.

- Fixes: vercel#188
- Closes vercel#193

---------

Co-authored-by: Alfredo Maria Milano <[email protected]>
Co-authored-by: Steven <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression 1.7.3 to 1.7.4: __nccwpck_require__ is not defined

2 participants